﻿#ifndef FLOWCELLPARAM_H
#define FLOWCELLPARAM_H

#include <QObject>
#include <QVariant>
#include <QMetaType>

#include "Interface_Global.h"

namespace CVV
{

namespace Interface
{
/**
 * @brief The FlowCellParam 插件参数变量数据
 */
class INTERFACE_EXPORT FlowCellParam : public QObject
{
    Q_OBJECT

    Q_PROPERTY(QString Code READ code WRITE setCode)
    Q_PROPERTY(QString ParamType READ paramType WRITE setParamType)
    Q_PROPERTY(QString DefaultValue READ defaultValue WRITE setDefaultValue)
    Q_PROPERTY(QString Type READ type WRITE setType)
    Q_PROPERTY(QString Description READ description WRITE setDescription)
    Q_PROPERTY(QString Sort READ sort WRITE setSort)
    Q_PROPERTY(QString Name READ name WRITE setName)
    Q_PROPERTY(QString Value READ value WRITE setValue)
    Q_PROPERTY(QString Save READ isSave WRITE setIsSave)

    Q_PROPERTY(QString PluginCode READ pluginCode WRITE setPluginCode)
    Q_PROPERTY(QString PluginID READ pluginId WRITE setPluginId)

    Q_PROPERTY(QVariant UserTypeValue READ userTypeValue WRITE setUserTypeValue)
    Q_PROPERTY(QString AssociatedCode READ associatedCode WRITE setAssociatedCode)

public:
    Q_INVOKABLE explicit FlowCellParam(QObject *parent = nullptr);
    virtual ~FlowCellParam();

    Q_INVOKABLE FlowCellParam(const FlowCellParam &flowCellPlugin);
    Q_INVOKABLE FlowCellParam& operator=(const FlowCellParam &flowCellPlugin);

    Q_INVOKABLE QString code() const;
    Q_INVOKABLE void setCode(const QString &code);

    Q_INVOKABLE QString paramType() const;
    Q_INVOKABLE void setParamType(const QString &paramType);

    Q_INVOKABLE QString defaultValue() const;
    Q_INVOKABLE void setDefaultValue(const QString &defaultValue);

    Q_INVOKABLE QString type() const;
    Q_INVOKABLE void setType(const QString &type);

    Q_INVOKABLE QString description() const;
    Q_INVOKABLE void setDescription(const QString &description);

    Q_INVOKABLE QString sort() const;
    Q_INVOKABLE void setSort(const QString &sort);

    Q_INVOKABLE QString name() const;
    Q_INVOKABLE void setName(const QString &name);

    Q_INVOKABLE QString value() const;
    Q_INVOKABLE void setValue(const QString &value);

    Q_INVOKABLE QString isSave() const;
    Q_INVOKABLE void setIsSave(const QString& value);


    Q_INVOKABLE QString pluginId() const;
    Q_INVOKABLE void setPluginId(const QString &pluginId);

    Q_INVOKABLE QString pluginCode() const;
    Q_INVOKABLE void setPluginCode(const QString &pluginCode);

    /**
     * @brief userTypeValue 自定义数据类型
     * @return
     */
    Q_INVOKABLE QVariant userTypeValue() const;
    Q_INVOKABLE void setUserTypeValue(const QVariant &value);

    /**
     * @brief associatedCode 关联code
     * @return
     */
    Q_INVOKABLE QString associatedCode() const;
    Q_INVOKABLE void setAssociatedCode(const QString &code);



signals:
public slots:

private:
    QString m_code;
    QString m_value;
    QString m_name;
    QString m_paramType;
    QString m_defaultValue;
    QString m_type;
    QString m_description;
    QString m_sort;
    QString m_bSave;
    QString m_pluginCode;
    QString m_pluginId;
    QVariant m_userTypeValue;
    QString m_associatedCode;               // 关联code

};

}

}
Q_DECLARE_METATYPE(CVV::Interface::FlowCellParam)

#endif // PARAMVARIABLE_H
